device.wakeUp()
sleep(3000);
swipe(600,1400,600,800,200);
try{
device.setMusicVolume(0)

}catch(err){
    log(err)
    }


try{
    //华为音乐签到
app.startActivity({        
      action: "android.intent.action.VIEW",
             data: "hwfmradio://com.huawei.android.FMRadio/showH5?pver=121000000&portal=hwmusic&from=com.huawei.musicplatform.campaignh5&needback=0&channelid=1&url=https://campaign-music.hicloud.com/camp/235840624979439616/index.html?appsafearguments=true&activity=true&operator=f2&share=false&transparentstatusbar=true&hideactionbar=true&needback=true&isext=false",
                   packageName: "com.huawei.android.FMRadio"
             });
sleep(15000)
}catch(err){
    log(err)
    }
// 在此处给脚本排队即可
url1 = "/sdcard/脚本/收音机自动下载shell版.js"
url2 = "/sdcard/脚本/音乐自动下载抽奖shell版.js"
url3 = "/sdcard/脚本/获取花币数量shell版.js"
url4 = "/sdcard/脚本/小华花圃.js"
url5="/sdcard/脚本/视频自动下载shell版.js"
  let filePathList = [url5,url3];
  //let filePathList = [url2, url3, url4];
//let filePathList = [url3, url4];

filePathList = filePathList.map(function (filePath) {
    return files.path(filePath);

});
events.on("exit", function () {
    log("exit");
});
setInterval(function () { }, 1000);
while (1) {
    if (filePathList.length > 0) {
        sleep(5000)
        let e = engines.execScriptFile(filePathList[0]);
        while (!e.getEngine()); //等待脚本运行
        let currentScriptEngine = e.getEngine();
        while (1) {
            if (currentScriptEngine.isDestroyed()) {
                break;
            } else {
                sleep(100);
            }
        }

    } else {
        engines.myEngine().forceStop();
    }
    filePathList.shift();
}